package com.tiancheng.onecode.utils;

import com.tiancheng.onecode.model.dto.PayPlatformDTO;
import com.tiancheng.onecode.model.dto.PlatformApplicationDTO;

/**
 * @Author: kellen
 * @Description: 平台应用工具类
 * @Date: create in 2024/12/24 17:44
 */
public class PlatformApplicationUtils {

    /**
     * 获取应用信息，与登录态相关
     * @return
     */
    public static PlatformApplicationDTO getApplication(){
        // 暂时写死，以后根据当前登录态切换
        final PlatformApplicationDTO platformApplicationDTO = new PlatformApplicationDTO();
        PayPlatformDTO platform = MerchantContext.getPlatform();
        platformApplicationDTO.setPlatformCode(platform.getPlatformCode());
        platformApplicationDTO.setPlatformName(platform.getPlatformName());
        platformApplicationDTO.setOrgPaymentChannelId(platform.getOrgPaymentChannelId());
        platformApplicationDTO.setClientId(platform.getClientId());
        platformApplicationDTO.setClientSecret(platform.getClientSecret());
        return platformApplicationDTO;
    }

}
